#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N;
	scanf("%d", &N);
	int a[N];
	int i = 0;
	while(i < N)
	{
		scanf("%d", &a[i++]);
	}
	
	int count = 0;
	
	for (i = 0; i < N - 1; i++)
	{
		if (a[i] == 0)
			continue; 
		for (int j = i + 1; j < N; j++)
		{
			if (a[j] == -a[i])
			{
				a[j] = 0;
				count++;
				break;
			}
		}
	}
	
	printf("%d", count);
	return 0;
}
